﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;

namespace tc58News
{
	class Program
	{
		static void Main(string[] args)
		{
			Channel buffer = new Channel();

			Producer p = new Producer(buffer);

			Consumer c = new Consumer(buffer);



			HtmlSource source = new HtmlSource()
			{
				//SourceUrl = "http://www.58tc.cn/newslist.aspx?code=TeChanWenHua",
				//CateType = 1

				//SourceUrl = "http://www.58tc.cn/newslist.aspx?code=TeChanDianGu",
				//CateType = 2

				//SourceUrl = "http://www.58tc.cn/newslist.aspx?code=TeChanZhiXiang",
				//CateType = 3

				SourceUrl = "http://www.58tc.cn/newslist.aspx?code=FeiWuZhiWenHuaYiChan",
				CateType = 4
				
			};

			Thread thread2 = new Thread(new ParameterizedThreadStart(p.Produce));
			thread2.IsBackground = true;
			thread2.Start(source);


			for (int i = 0; i < 5; i++)
			{
				Thread thread1 = new Thread(new ThreadStart(c.Consume));
				thread1.IsBackground = true;
				thread1.Start();
			}



			Console.ReadLine();

			;


		}
	}
}